#ifndef JSONPARSER_EXPORTS
#define JSONPARSER_EXPORTS 
#endif
 
#include "CJsonParseFactory.h"
#include "CJsonParserImpl.h"
CJsonParseFactory*  CJsonParseFactory::m_cInstance = 0;

CJsonParseFactory::CJsonParseFactory(void)
{
	 m_cJsonParserImpl = NULL;
}

CJsonParseFactory::~CJsonParseFactory(void)
{
	if (m_cJsonParserImpl)
	{
		delete m_cJsonParserImpl  ;
		m_cJsonParserImpl = NULL;
	}
}

 

CJsonParseFactory* CJsonParseFactory::GetInstance()
{
	if (0 == m_cInstance)
	{
		m_cInstance=new CJsonParseFactory();
		m_cInstance->m_cJsonParserImpl = NULL;
	}
	return m_cInstance;
}
bool  CJsonParseFactory::ClearInstance()
{
	if (m_cInstance)
	{ 
		delete m_cInstance;
		m_cInstance = 0;
	}
	return true;
}
 
IJsonParser * CJsonParseFactory::CreateJsonParser()
{
	 m_cJsonParserImpl = new CJsonParserImpl();
	 if (!m_cJsonParserImpl)
	 {
		 return NULL;
	 }
	 return m_cJsonParserImpl;
}